from openstates.scrape import State
from .bills import MOBillScraper
from .events import MOEventScraper

# from .votes import MOVoteScraper


class Missouri(State):
    scrapers = {
        "bills": MOBillScraper,
        # 'votes': MOVoteScraper,
        "events": MOEventScraper,
    }
    legislative_sessions = [
        {
            "_scraped_name": "2019 Regular Session",
            "classification": "primary",
            "identifier": "2019",
            "name": "2019 Regular Session",
            "start_date": "2019-01-09",
            "end_date": "2019-05-29",
        },
        {
            "_scraped_name": "2019 1st Extraordinary Session",
            "classification": "primary",
            "identifier": "2019S1",
            "name": "2019 First Extraordinary Session",
            "start_date": "2019-09-09",
            "end_date": "2019-09-25",
        },
        {
            "_scraped_name": "2020 Regular Session",
            "classification": "primary",
            "identifier": "2020",
            "name": "2020 Regular Session",
            "start_date": "2020-01-08",
            "end_date": "2020-05-27",
        },
        {
            "_scraped_name": "2020 1st Extraordinary Session",
            "classification": "primary",
            "identifier": "2020S1",
            "name": "2020 First Extraordinary Session",
            "start_date": "2020-07-27",
            "end_date": "2020-09-16",
        },
        {
            "_scraped_name": "2020 2nd Extraordinary Session",
            "classification": "primary",
            "identifier": "2020S2",
            "name": "2020 Second Extraordinary Session",
            "start_date": "2020-11-05",
            "end_date": "2020-12-10",
        },
        {
            "_scraped_name": "2021 Regular Session",
            "classification": "primary",
            "identifier": "2021",
            "name": "2021 Regular Session",
            "start_date": "2021-01-06",
            "end_date": "2021-05-25",
        },
        {
            "_scraped_name": "2021 1st Extraordinary Session",
            "classification": "primary",
            "identifier": "2021S1",
            "name": "2021 1st Extraordinary Session",
            "start_date": "2021-06-23",
            "end_date": "2021-06-30",
        },
        {
            "_scraped_name": "2022 Regular Session",
            "classification": "primary",
            "identifier": "2022",
            "name": "2022 Regular Session",
            "start_date": "2022-01-05",
            "end_date": "2022-05-13",
            "active": False,
        },
        {
            "_scraped_name": "2022 1st Extraordinary Session",
            "classification": "primary",
            "identifier": "2022S1",
            "name": "2022 1st Extraordinary Session",
            "start_date": "2022-09-15",
            # TODO: real end date when session is over
            "end_date": "2021-09-23",
            "active": False,
        },
        {
            "_scraped_name": "2023 Regular Session",
            "classification": "primary",
            "identifier": "2023",
            "name": "2023 Regular Session",
            "start_date": "2023-01-04",
            "end_date": "2023-05-14",
            "active": False,
        },
        {
            "_scraped_name": "2024 Regular Session",
            "classification": "primary",
            "identifier": "2024",
            "name": "2024 Regular Session",
            "start_date": "2024-01-03",
            "end_date": "2024-05-17",
            "active": False,
        },
        {
            "_scraped_name": "2025 Regular Session",
            "classification": "primary",
            "identifier": "2025",
            "name": "2025 Regular Session",
            "start_date": "2025-01-08",
            "end_date": "2025-05-16",
            "active": False,
        },
        {
            "_scraped_name": "2025 1st Extraordinary Session",
            "classification": "primary",
            "identifier": "2025S1",
            "name": "2025 1st Extraordinary Session",
            "start_date": "2025-06-02",
            # TODO: real end date when session is over
            "end_date": "2025-06-13",
            "active": False,
        },
        {
            "_scraped_name": "2025 2nd Extraordinary Session",
            "classification": "primary",
            "identifier": "2025S2",
            "name": "2025 2nd Extraordinary Session",
            "start_date": "2025-09-03",
            # TODO: real end date when session is over
            "end_date": "2025-09-13",
            "active": False,
        },
        {
            "_scraped_name": "2026 Regular Session",
            "classification": "primary",
            "identifier": "2026",
            "name": "2026 Regular Session",
            "start_date": "2026-01-07",
            "end_date": "2026-05-15",
            "active": True,
        },
    ]
    ignored_scraped_sessions = [
        "2018 Regular Session",
        "2018 Special Session",
        "2018 1st Extraordinary Session",
        "2007 Regular Session",
        "2010 Extraordinary Session",
        "2002 Regular Session",
        "1999 Regular Session",
        "2013 Extraordinary Session",
        "2007 Extraordinary Session",
        "2003 2nd Extraordinary Session",
        "2014 Regular Session",
        "2017 Extraordinary Session",
        "2005 Regular Session",
        "2011 Extraordinary Session",
        "2006 Regular Session",
        "2004 Regular Session",
        "2015 Regular Session",
        "2003 1st Extraordinary Session",
        "2010 Regular Session",
        "2001 Regular Session",
        "2017 2nd Extraordinary Session",
        "2003 Regular Session",
        "2009 Regular Session",
        "2005 Extraordinary Session",
        "2017 Regular Session",
        "2000 Regular Session",
        "2013 Regular Session",
        "2011 Regular Session",
        "2001 Extraordinary Session",
        "2012 Regular Session",
        "2008 Regular Session",
        "2016 Regular Session",
        "2019 1st Extraordinary Session",
    ]

    full_session_list = [
        "2023 Regular Session",
        "2022 1st Extraordinary Session",
        "2022 Regular Session",
        "2021 1st Extraordinary Session",
        "2021 Regular Session",
        "2020 2nd Extraordinary Session",
        "2020 1st Extraordinary Session",
        "2020 Regular Session",
        "2019 1st Extraordinary Session",
        "2019 Regular Session",
        "2018 1st Extraordinary Session",
        "2018 Special Session",
        "2018 Regular Session",
        "2017 2nd Extraordinary Session",
        "2017 Extraordinary Session",
        "2017 Regular Session",
        "2016 Regular Session",
        "2015 Regular Session",
        "2014 Regular Session",
        "2013 Extraordinary Session",
        "2013 Regular Session",
        "2012 Regular Session",
        "2011 Extraordinary Session",
        "2011 Regular Session",
        "2010 Extraordinary Session",
        "2010 Regular Session",
        "2009 Regular Session",
        "2008 Regular Session",
        "2007 Extraordinary Session",
        "2007 Regular Session",
        "2006 Regular Session",
        "2005 Extraordinary Session",
        "2005 Regular Session",
        "2004 Regular Session",
        "2003 2nd Extraordinary Session",
        "2003 1st Extraordinary Session",
        "2003 Regular Session",
        "2002 Regular Session",
        "2001 Extraordinary Session",
        "2001 Regular Session",
        "2000 Regular Session",
    ]

    def get_session_list(self):
        return self.full_session_list
